<%@page import="com.serviceprovider.business.utility.SecurityContextUser"%>
<%@include file="/WEB-INF/taglibs/common/taglibs.jsp" %>
<form:form commandName="criteria" method="post" id="reportForm">
        <table border="0" cellpadding="2" cellspacing="0" class="formTable">
            <tr>
				<td></td>
            </tr>
            <%
		    Object isAdmin = SecurityContextUser.isAdmin();
		    if(Boolean.TRUE.equals(isAdmin)){
		        %>
		        <tr>
	                <td>Providers:</td>
	                <td colspan="3">
	                    <form:select path="providerId" cssStyle="width:50%" onchange="document.forms['reportForm'].submit();">
                                <form:option value=""/>
                            <c:forEach items="${providers}" var="provider" varStatus="i">
	                            <form:option value="${provider.id}">${provider.fullName}</form:option>
	                         </c:forEach>
	                    </form:select>
	                </td>
	            </tr>   
		        <%
		    }
		    %>
            <tr>
                <td><spring:message code="sp.report.selectreport.label.fromdate" />:</td>
                <td><component:calendar bindPath="dateFrom"/></td>

                <td><spring:message code="sp.report.selectreport.label.todate" />:</td>
                <td><component:calendar bindPath="dateTo"/></td>
            </tr>
            <tr>
                <td>Payees:</td>
                <td colspan="3">
				    <form:select path="payees" multiple="true" cssStyle="width:50%">
                        <c:forEach items="${payees}" var="payee" varStatus="i">
                            <form:option value="${payee.id}">${payee.fullName}</form:option>
                         </c:forEach>
                    </form:select>
                </td>
            </tr>
            <tr>
                <td><spring:message code="sp.report.selectreport.label.transactionstatus" />:</td>
                <td><form:select path="status">
                        <form:option value="-1">All</form:option>
						<c:forEach items="${statuses}" var="item" varStatus="i">
						    <form:option value="${item.id}">${item.name}</form:option>
						 </c:forEach>
					</form:select>
                </td>
                <td><spring:message code="sp.report.selectreport.label.selectreport" />:</td>
                <td>
                	<form:select path="reportType" onchange="document.forms['reportForm'].submit();">
						<c:forEach items="${reportTypes}" var="item" varStatus="i" >
						    <form:option value="${item}">${item}</form:option>
						 </c:forEach>                	
                	</form:select>
                	&nbsp;&nbsp;
                	<a href="<c:url value="custom_report.htm" />">Custom Reports</a>
                </td>
                
            </tr>
            <c:if test='${criteria.reportType == "Custom Fee Report" }'>
                <tr>
                <td align="right" colspan="4">${criteria.reportType}
                    Filter columns:
                    <c:forEach items="${selectedFee}" var="fee">
                        <form:checkbox path="selectedFee" value="${fee}"/>&nbsp;<fmt:message key="TransactionDetail.${fee}" />
                    </c:forEach>
                </td>
            </tr>
            </c:if>
            <tr>
                <td></td><td><input type="submit" class='ui-button ui-state-default ui-corner-all' value="Generate"/></td>
            </tr>
        </table>
        <br/>
    </form:form>  
 
